package cn.fantasy.singleton;

/**
 * @author ET
 * @description TODO
 * @date 2023/3/10 16:54
 * @Version V1.0
 */
public class Singleton {

    private volatile static Singleton uniqueInstance;

    public Singleton getUniqueInstance() {
        if (uniqueInstance == null) {
            synchronized (Singleton.class) {
                if (uniqueInstance == null) {
                    uniqueInstance = new Singleton();
                }
            }
        }
        return uniqueInstance;
    }
}
